home *** CD-ROM | disk | FTP | other *** search
/ Super PC 31 / Super PC 31 (Shareware).iso / spc / inter / speakf / fuente / lpc / readme < prev   
Encoding:
Text File  |  1995-11-07  |  1.7 KB  |  36 lines

  1. Included in this distribution is the lpc.c module, a header file for the
  2. routines in it called lpc.h, and a small test program which illustrates a
  3. typical set of calls to it called lpctest.c.
  4.  
  5. To compile lpctest.c, you need to link it with lpc.o and the math library.
  6. It will take sound samples from stdin, compress & decompress them with LPC,
  7. and output the resulting samples to stdout.
  8.  
  9. The subroutines in lpc.c are as follows:
  10.  
  11. The lpc_init routine specifies the length of a single frame to be processed by
  12. the other LPC subroutines. This number is expressed in samples, and lpc_init
  13. should be called before anything else. It also resets all other state kept
  14. between frames, and can be called again when there's a break in what it being
  15. encoded or decoded (such as between talk spurts):
  16.  
  17. int  lpc_init(int framelen);
  18.  
  19.  
  20. The lpc_analyze routine is used to convert a group of samples into an LPC
  21. frame. State is kept between calls to smooth out transitions between frames, so
  22. this routine should be called with frames in order:
  23.  
  24. void lpc_analyze(unsigned char *buf, lpcparams_t *params);
  25.  
  26.  
  27. The lpc_synthesize routine is used to convert an LPC frame back into a group of
  28. samples. Also, a speed parameter may be specified to speed up or slow down the
  29. speech (without altering the pitch). The length of the buffer returned depends
  30. on the speed. If speed==1.0, it will be the same as the length passed to the
  31. lpc_init call. If speed==2.0, it will be half that. The call to lpc_synthesize
  32. returns this length. Note that the speed parameter is a float -- passing an
  33. integer will cause unpredictable results:
  34.  
  35. int  lpc_synthesize(lpcparams_t *params, float speed, unsigned char *buf);
  36.